<?php
namespace Plu\Library\Services\Redis\Media;

use Plu\Library\Services\ServiceBase;

class MediaScoreRedis extends ServiceBase {
	const key_of_media_core = "media:score:%d";

	public static function getGuid($mediaId) {
		return sprintf(self::key_of_media_core, $mediaId);
	}

	/**
	 * 获取视频评分人数
	 */
	public function getCount($mediaId) {
		$redis = $this->getRedis('cache');

		return $redis->sCard(self::getGuid($mediaId));
	}
}
?>
